//
//  HXDXinTeXingViewController.m
//  qingDaoCircleOfLife
//
//  Created by huxuedong on 15/11/21.
//  Copyright © 2015年 huxuedong. All rights reserved.
//

#import "HXDGuideViewController.h"
#import "HXDFunction.h"
#import "AppDelegate.h"

@implementation HXDGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:kUIScreenBounds];
    scrollView.contentSize = CGSizeMake(3 * kUIScreenWidth, 0);
    scrollView.pagingEnabled = YES;
    scrollView.showsHorizontalScrollIndicator = NO;
    scrollView.bounces = NO;
    [self.view addSubview:scrollView];
    for (int i = 0; i < 3; i++) {
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(i * kUIScreenWidth, 0, kUIScreenWidth, kUIScreenHeight)];
        NSString *imgName = [NSString stringWithFormat:@"guide_%d",i];
        imageView.image = [UIImage imageNamed:imgName];
        [scrollView addSubview:imageView];
        if (i == 2) {
            UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(enter)];
            imageView.userInteractionEnabled = YES;
            [imageView addGestureRecognizer:tap];
        }
    }
}

- (void)enter {
    [HXDFunction saveValue:YES forKey:kFirstEnter];
    [[NSNotificationCenter defaultCenter] postNotificationName:kNotificationEnter object:nil];
}

@end
